# coding:utf-8
import asyncio

from aiobsonrpc import ClientConnect

HOST_PORT = ("127.0.0.1", 8000)


async def main():
    # Cut-the-corners TCP Client:
    conn = ClientConnect(*HOST_PORT)
    await conn.run()
    rpc = conn.rpc

    # Call
    server = rpc.get_peer_proxy()
    result = await server.swapper('Hello World!')
    print(result)

    conn.writer.close()


if __name__ == '__main__':
    asyncio.run(main())
